Skip to content

[rebranch] Various JIT failure workarounds #9135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 20, 2024

Conversation

bnbarham
Copy link

Cherry-picks various workarounds for swift test failures that were on stable/20230725 but not on next.

@bnbarham bnbarham requested review from lhames and benlangmuir August 16, 2024 19:37
@bnbarham
Copy link
Author

@swift-ci please test

@bnbarham
Copy link
Author

@swift-ci please test llvm

lhames added 2 commits August 16, 2024 17:50
LLVM currently emits dubious symbol sizes for aliases. E.g. assembling
the following with LLVM top-of-tree...

```
$ cat foo.s
        <snip>
        .data
        .globl  base
base:
        .dword  42
        .size   base, 8

.set alias, base+4
```

results in both base and alias having symbol size 8, even alias starts at
base + 4. This also means that alias extends past the end of the .data
section in this example.

We should probably teach LLVM not to do this in the future, but as a short-term
fix this patch teaches JITLink to simply truncate symbols that would extend
past the end of their containing block.

rdar://114207607
(cherry picked from commit 6267697)

Conflicts:
	llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h
Swift is currently generating multiple .rodata sections with a combination of
SHF_ALLOC and (SHF_ALLOC | SHF_WRITABLE) flags and this was tripping an assert
in the ELFLinkGraphBuilder. As a temporary workaround this patch just uses the
union of the requested permissions.

rdar://114207428
(cherry picked from commit ead32e1)

Conflicts:
	llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h
@bnbarham
Copy link
Author

@swift-ci please test

@bnbarham
Copy link
Author

@swift-ci please test llvm

@bnbarham
Copy link
Author

Looks to be fixed 🥳

@bnbarham bnbarham merged commit ce487d4 into swiftlang:stable/20240723 Aug 20, 2024
2 of 5 checks passed
@bnbarham bnbarham deleted the jit-failures branch August 20, 2024 00:42
@bnbarham
Copy link
Author

False alarm. I didn't realize that swift tests weren't running here :( Still all the same test failures in https://ci.swift.org/view/Swift%20rebranch/job/oss-swift-rebranch-pr-test-ubuntu-20_04.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants